import { FormProps, FormSchema } from '@/components/Table'
import { BasicColumn } from '@/components/Table/src/types/table'

// 用户列表
export function getLogsBasicColumns(): BasicColumn[] {
  return [
    {
      title: '请求名称',
      customEllipsis: true,
      width: 120,
      dataIndex: 'requestName'
    },
    {
      title: '请求IP',
      customEllipsis: true,
      width: 80,
      dataIndex: 'ip'
    },
    {
      title: '请求URL',
      customEllipsis: true,
      width: 140,
      dataIndex: 'uri'
    },
    {
      title: '请求方式',
      customEllipsis: true,
      width: 80,
      dataIndex: 'type'
    },
    {
      title: '类名/方法名',
      customEllipsis: true,
      width: 120,
      dataIndex: 'method'
    },
    {
      title: '操作账号',
      customEllipsis: true,
      width: 120,
      dataIndex: 'userAcct'
    },
    {
      title: '请求参数',
      customEllipsis: true,
      width: 140,
      dataIndex: 'requestBodys'
    },
    {
      title: '响应参数',
      customEllipsis: true,
      width: 140,
      dataIndex: 'returnJson'
    },
    {
      title: '创建时间',
      customEllipsis: true,
      width: 120,
      dataIndex: 'createDate'
    },
    {
      title: '操作',
      width: 50,
      dataIndex: 'operate'
    }
  ]
}

export function getSearchFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 80,
    baseColProps: {
      span: 6,
      md: 10,
      xl: 8,
      xxl: 6
    },
    schemas: [
      {
        field: 'requestName',
        label: '请求名称',
        component: 'Input'
      },
      {
        field: 'requestUrl',
        label: '请求URL',
        component: 'Input'
      },
      {
        field: 'method',
        label: '类或方法',
        component: 'Input'
      },
      {
        field: 'userAcct',
        label: '操作账号',
        component: 'Input'
      }
    ]
  }
}
